/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package RemoteDesktop;

import Thread.ThreadFile;
import java.awt.BorderLayout;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;

/**
 *
 * @author Oho
 */
public class ConnectRemote extends Thread{
    ServerSocket sv ;
    int port ;
//    private JFrame frame;// = new JFrame();
    //JDesktopPane represents the main container that will contain all
    //connected clients' screens
    private JDesktopPane desktop = new JDesktopPane();

    public ConnectRemote(int port)
    {
        this.port = port;
    }
    
    @Override
    public void run()
    {
        try {
            sv = new ServerSocket(port);
               while(true)
               {
                   Socket sk=sv.accept();
                   //new ThreadImages(null, null)
                   new ClientHook(sk,desktop);
               }
        } catch (IOException ex) {
            Logger.getLogger(ConnectRemote.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
  
}
